package com.zxh.blog.service.impl;

import com.zxh.blog.dao.ArticleDao;
import com.zxh.blog.domain.Article;
import com.zxh.blog.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {
	@Autowired
	ArticleDao articleDao;

	public Integer addArticle(Article article) {
		Integer save = articleDao.save(article);
		return save;
	}

	public void updateArticle(Article article) {
		articleDao.update(article);
	}

	public void deleteByIds(int[] ids) {
		articleDao.batchDelete(ids);
	}

	public List<Article> selectByList() {
		List<Article> list = articleDao.selectByList();
		return list;
	}
}
